<template>
<div class="header">
    <div class="header-left">
      <span class="iconfont">&#xe624;</span>
    </div>
    <div class="header-input" @click="jumpSeach">
      <span class="iconfont search">&#xe632;</span>
      输入城市/景点/游玩主题
      </div>
      <router-link to='/CityList'>
          <div class="header-right">
            {{this.city}}
          <span class="iconfont arrow-icon">&#xe64a;</span>
        </div>
      </router-link>
</div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city'])
  },
  methods: {
    jumpSeach () {
      this.$router.push('/CityList')
    }
  }
}

</script>

<style lang="stylus" scoped>
@import '~style/varibles.styl'
.header
  display: flex
  height: .86rem
  background-color: $bgColor
  color:#fff
  align-items: center
  .header-left
    width: .64rem
    float: left
    text-align :center
  .header-right
    min-width: 1.04rem
    float: right
    text-align :center
    color #fff
    .arrow-icon
      font-size: .22rem
  .header-input
    flex :1
    color #ccc
    margin-left:.02rem
    margin-right :.02rem
    background :#fff
    border-radius:.1rem
    line-height :.64rem
    position relative
    padding-left :.2rem
</style>
